﻿using HomeCareLibrary.Core.Dtos;
using HomeCareLibrary.DataAccess;
using HomeCareLibrary.Repository;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using HomeCareLibrary.AppService.Mappers;
using HomeCareLibrary.Core.DataContracts;



namespace HomeCareLibrary.AppService
{
    public class IdeaAppService
    {
        public List<CTIdeaDto> GetIdeaList(TasksRequest request)
        {
            using (var unitOfWork = new UnitOfWork())
            {
                var repository = new Repository<CTIdea>(unitOfWork);
                var queryParameter = string.Format("@paramUserId={0}, @paramHomeNumber={1}, @paramRequestedMonth={2}, @paramRequestedYear={3}", request.UserId, request.HomeNumber, request.Month, request.Year);
                return repository.ExecuteFuntion("[sp_Ideas_List]", queryParameter).ToDTOs();
            }
        }
    }
}
